from PyInquirer import prompt

questions = [
    {
        "type": "input",
        "default": "Lucy",
        "name": "user",
        "message": "what is your name?",
    },
    {
        "type": "confirm",
        "default": True,
        "name": "continue",
        "message": "continue the last test?",
    },
    {
        "type": "input",
        "name": "filename",
        "message": "testing file name",
        "when": lambda answer: not answer["continue"],
    },
    {
        "type": "list",
        "name": "book",
        "message": "which book to use",
        "default": "book2",
        "choices": [
            {"name": "book one", "value": "book1"},
            {"name": "book two", "value": "book2"},
        ],
    },
]

answer = prompt(questions)

print(answer)
